<!--
 * @Description:投诉历史
 * @Autor: 刘诗文
 * @Date: 2020-12-17 15:27:01
 * @LastEditors: 刘诗文
 * @LastEditTime: 2020-12-17 15:35:22
-->
<template>
  <div>
    <FilterTable
      ref="table"
      height="500"
      selectionType="single"
      :columns="columns"
      :datakey="'rows'"
      columnsRef="complaintHistorylsw"
      :onColumnsChange="columns => (this.columns = columns)"
      :onRowSelectChange="onRowSelectChange"
    >
    </FilterTable>
  </div>
</template>
<script>
import { dictionary } from '@/utils/dictMixin';
export default {
  name: 'complaintHistory',
  mixins: [dictionary],
  data() {
    this.selectedData = null;
    this.BaseTable = null;
    return {
      columns: this.createTableColumns()
    };
  },
  mounted() {
    this.BaseTable = this.$refs.table;
  },
  methods: {
    createTableColumns() {
      return [
        {
          title: '序号',
          dataIndex: 'index',
          width: 50,
          render: props => {
            return <span>{props.row.index + 1}</span>;
          }
        },
        {
          title: '投诉编号',
          dataIndex: 'a1'
        },
        {
          title: '车牌号',
          dataIndex: 'license'
        },
        {
          title: '车主姓名',
          dataIndex: 'ownerName'
        },
        {
          title: '车型',
          dataIndex: 'brand'
        },
        {
          title: 'VIN',
          dataIndex: 'vin'
        },
        {
          title: '投诉类型',
          dataIndex: 'a2'
        },
        {
          title: '业务分类',
          dataIndex: 'a3'
        },
        {
          title: '投诉渠道',
          dataIndex: 'a4'
        }
      ];
    },
    onRowSelectChange(row) {
      if (!row.length) {
        this.selectedData = null;
      } else {
        this.selectedData = row[0];
      }
    }
  }
};
</script>
<style lang="less" scoped></style>
